export interface ESIndices {
  scriptDocs: string
  miscConfig: string
  talentConfig: string
  controlBuffConfig: string
  tabConfig: string
}

export const ES_CONFIG = {
  baseUrl: '/api/es',
  indices: {
    scriptDocs: 'combat_script_docs',
    miscConfig: 'misc_config',
    talentConfig: 'talent_config',
    controlBuffConfig: 'control_buff_config',
    tabConfig: 'tab_config'
  } as ESIndices
}

export const ES_INDEXS = {
  scriptDocs: 'combat_script_docs',
  miscConfig: 'misc_config',
  talentConfig: 'talent_config',
  controlBuffConfig: 'control_buff_config',
  tabConfig: 'tab_config'
} as ESIndices

export interface SearchResponse<T> {
  hits: {
    total: {
      value: number
    }
    hits: Array<{
      _source: T
      _score: number
    }>
  }
}
